Source: fivethirtyeight
AKA “Please just don’t make me point-and-click 100 charts”
Source: Hadley Wickham
Source: ggplot2
In the first edition of @FT's World Cup Extra series of stats-y briefings, @muradahmed and I ask: as curtain-raisers go, just how underwhelming is Russia vs Saudi Arabia?https://t.co/0aQXcaD9YV pic.twitter.com/GOXVyVlRW7
— John Burn-Murdoch (@jburnmurdoch) June 13, 2018
Source: Hadley Wickham
| name | year | category | lat | long | wind | pressure |
|---|---|---|---|---|---|---|
| Richard | 2010 | 0 | 15.8 | -82.1 | 40 | 1006 |
| Dean | 1989 | 2 | 34.0 | -64.9 | 90 | 968 |
| Allison | 1995 | 1 | 24.7 | -86.2 | 65 | 987 |
| Chantal | 1995 | 0 | 21.1 | -64.9 | 35 | 1008 |
| Nadine | 2012 | 0 | 17.5 | -44.8 | 35 | 1004 |
| Gustav | 1990 | 1 | 39.4 | -50.9 | 75 | 978 |
| Pablo | 1995 | 0 | 11.5 | -41.9 | 50 | 997 |
| Beryl | 1994 | 0 | 29.7 | -85.6 | 35 | 1007 |
| Jeanne | 2004 | 1 | 27.6 | -69.5 | 75 | 972 |
| Richard | 2010 | 0 | 16.7 | -80.6 | 35 | 1006 |
ggplot(data = )
aes(x = , y = , color = )
X or Y
Color or Fill
Size
Shape
Others: transparency, animations, faceting
Plots are often called their geometric object(s).
geom_bar() or geom_col()
geom_line()
geom_point()
?
Path of Hurricane Katrina
Before
scale_x_continuous()
After
scale_x_log10()
Before
scale_size_continuous(breaks = c(25, 75, 125))
After
scale_size_continuous(range = c(0.5, 20), breaks = c(25, 75, 125))
coord_polar()
Facet wrap
facet_wrap(~category)
Facet grid
facet_grid(month~status)
Count
Default theme
fivethirtyeight theme
urbnthemes
Source: Policyviz by Jon Schwabish
Animation
By Sarah Strochak
3.2, 4.2, 4.3, 4.7, 5.12
A
B
Once you understand ggplot2, it is really useful for doing 90% of the results with 10% of the effort
(Jennfer Hill)
A+
B+
A+